package com.example.demo;

import org.springframework.context.annotation.Configuration;
import org.springframework.security.oauth2.config.annotation.configurers.ClientDetailsServiceConfigurer;
import org.springframework.security.oauth2.config.annotation.web.configuration.AuthorizationServerConfigurerAdapter;

/**
 * @Author：Luohuiyong
 * @Description:
 * @Date: Created in 11:34 2019/1/10
 */
@Configuration
public class AuthorizationConfiguration extends AuthorizationServerConfigurerAdapter {
    @Override
    public void configure(ClientDetailsServiceConfigurer clients) throws Exception {
        clients.inMemory()                  //使用in-memory存储
                .withClient("client")// client_id
                .secret("secret")           // client_secret
                .authorizedGrantTypes("authorization_code")//该client允许的授权类型
                .scopes("app");// 允许的授权范围
    }
}
